x86/64: Fix a user of alloc_boot_pages() who should use
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 22 Feb 2007 22:27:40 +0000 (22:27 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 22 Feb 2007 22:27:40 +0000 (22:27 +0000)
alloc_boot_low_pages() instead.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/setup.c
xen/arch/x86/x86_64/mm.c

index 79adbd5f7f1590f05844734b2010c7b04ce1bc33..61271bbee304973d1e906dbf3d66df37f2413f9f 100644 (file)
@@ -476,7 +476,7 @@ void __init __start_xen(multiboot_info_t *mbi)
             s = initial_images_end;
         init_boot_pages(s, e);
 
-#if defined (CONFIG_X86_64)
+#if defined(CONFIG_X86_64)
         /*
          * x86/64 maps all registered RAM. Points to note:
          *  1. The initial pagetable already maps low 1GB, so skip that.
@@ -532,7 +532,12 @@ void __init __start_xen(multiboot_info_t *mbi)
         k = ((initial_images_end - initial_images_start) & ~PAGE_MASK) ? 1 : 0;
         k += (initial_images_end - initial_images_start) >> PAGE_SHIFT;
 
-        k = alloc_boot_low_pages(k, 1);
+#if defined(CONFIG_X86_32)
+        /* Must allocate within bootstrap 1:1 limits. */
+        k = alloc_boot_low_pages(k, 1); /* 0x0 - HYPERVISOR_VIRT_START */
+#else
+        k = alloc_boot_pages(k, 1);
+#endif
         if ( k == 0 )
             panic("Unable to allocate initial images memory\n");
 
index a482c10a060d4490c0e51e78959be6376a0eea72..b098b21f5e682b39ce1c656154f2ae4c0461053f 100644 (file)
@@ -44,7 +44,8 @@ struct page_info *alloc_xen_pagetable(void)
     if ( !early_boot )
         return alloc_domheap_page(NULL);
 
-    pfn = alloc_boot_pages(1, 1);
+    /* Early pagetables must come from low 1GB of memory. */
+    pfn = alloc_boot_low_pages(1, 1); /* 0x0 - 0x40000000 */
     return ((pfn == 0) ? NULL : mfn_to_page(pfn));
 }